<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<!-- RichFaces tag library declaration -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
<head>
<title>Sport Planet Web</title>
</head>

<body>
	<f:view>
		<a4j:form>

			<h:panelGrid columns="2">
				<rich:panel>
					<p>
						<h:outputText value="Sport Planet"
							style="font-weight:bold;font-size:large" />
					</p>
					<h:graphicImage value="/img/sportfile.jpg" />
					<p>
						<h:outputLabel for="sportNameInput"
							value="Please, choose the kind of sport" />
					</p>
					<rich:comboBox directInputSuggestions="true"
						defaultLabel="Enter kind of sport" />
					<!-- Список видов спорта, имена -->
				</rich:panel>

				<c:if test="true">

					<a4j:commandButton value="Login"
						oncomplete="#{rich:component('loginpanel')}.show()"
						reRender="loginpanel">
						<%-- <f:setPropertyActionListener value="#{project}"
							target="#{projectBean.selectedProject}" /> --%>
							
					</a4j:commandButton>

				</c:if>
				<c:if test="false">

				</c:if>

				<rich:modalPanel id="loginpanel">
					<f:facet name="header">
						<h:outputText value="Login" />
					</f:facet>
					<h:form>
						<h:panelGrid id="logininfo">
							<h:outputLabel value="Please, enter your details" />
							<h:outputLabel for="loginInput" value="login:" />
							<h:inputText id="nameInput" value="" />

							<h:outputLabel for="pwInput" value="password:" />
							<h:inputText id="pwInput" value="" />

							<h:panelGrid columns="2">
								<a
									onclick="Richfaces.hideModalPanel('loginpanel'); return false"
									href="#"> Close </a>
								<a4j:commandLink
									oncomplete="#{rich:component('loginpanel')}.hide()">
      							Ok
    						</a4j:commandLink>
							</h:panelGrid>
						</h:panelGrid>
					</h:form>

				</rich:modalPanel>


			</h:panelGrid>
			<rich:tabPanel width="70%">

				<rich:tab label="Info">

<%-- 					<h:form>
						<rich:panel>
							<rich:dataTable value="#{projectBean.projects}" var="project"
								onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
								onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
								cellpadding="0" cellspacing="0" width="300" border="0"
								ajaxKeys="#{projectBean.rowsToUpdate}" id="projecttable">

								<h:column>
									<a4j:commandButton value="Edit"
										oncomplete="#{rich:component('projectedit')}.show()"
										reRender="projectinfo">
										<f:setPropertyActionListener value="#{project}"
											target="#{projectBean.selectedProject}" />
									</a4j:commandButton>
								</h:column>

								<rich:column sortBy="#{project.name}">
									<f:facet name="header">
										<h:outputText value="Name" />
									</f:facet>
									<h:outputText id="name"
										value="#{project.name} + #{project.name}" />
								</rich:column>

								<rich:column sortBy="#{project.respmen}">
									<f:facet name="header">
										<h:outputText value="Project manager" />
									</f:facet>
									<h:outputText id="respmen" value="#{project.respmen}" />
								</rich:column>

								<rich:column sortBy="#{project.creationdate}">
									<f:facet name="header">
										<h:outputText value="Creation date" />
									</f:facet>
									<h:outputText id="createdate" value="#{project.creationdate}" />
								</rich:column>

								<rich:column sortBy="#{project.deadline}">
									<f:facet name="header">
										<h:outputText value="Deadline" />
									</f:facet>
									<h:outputText id="deadline" value="#{project.deadline}" />
								</rich:column>

								<f:facet name="footer">
									<rich:datascroller id="projecttable"></rich:datascroller>
								</f:facet>

							</rich:dataTable>
						</rich:panel>
					</h:form>

					<rich:modalPanel id="projectedit">
						<f:facet name="header">
							<h:outputText value="Project editing" />
						</f:facet>
						<h:form>
							<h:panelGrid id="projectinfo">
								<h:outputLabel for="nameInput" value="Name:" />
								<h:inputText id="nameInput"
									value="#{projectBean.selectedProject.name}" />
								<h:outputLabel for="respmenInput" value="Project manager:" />
								<h:inputText id="respmenInput"
									value="#{projectBean.selectedProject.respmen}" />
								<h:outputLabel for="creationdateInput" value="Creation date:" />
								<h:inputText id="creationdateInput"
									value="#{projectBean.selectedProject.creationdate}" />
								<h:outputLabel for="deadlineInput" value="Deadline:" />
								<h:inputText id="deadlineInput"
									value="#{projectBean.selectedProject.deadline}" />
								<h:panelGrid columns="2">
									<a
										onclick="Richfaces.hideModalPanel('projectedit'); return false"
										href="#"> Close </a>
									<a4j:commandLink actionListener="#{projectBean.save}"
										oncomplete="#{rich:component('projectedit')}.hide()"
										reRender="name, respmen, creationdate, deadline">
      							Save
    						</a4j:commandLink>
								</h:panelGrid>
							</h:panelGrid>
						</h:form>

					</rich:modalPanel>

					<a4j:keepAlive beanName="projectBean" /> --%>

				</rich:tab>

				<rich:tab label="Teams">
					<h:form>
						<p>
							<h:outputLabel for="teamNameInput"
								value="Please, choose the team name" />
						</p>
						<rich:comboBox directInputSuggestions="true"
							defaultLabel="Enter team name" />
						<!-- Список команд, имена (???) -->
						
						<p>
							<b>Players</b>
						</p>
						
						<rich:dataTable
							onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
							onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
							cellpadding="0" cellspacing="0" width="300" border="0"
							id="playerstable">

							<rich:column>
								<f:facet name="header">
									<h:outputText value="N" />
								</f:facet>
								<h:outputText id="number" value="aaaaaaa" />
							</rich:column>

							<rich:column>
								<f:facet name="header">
									<h:outputText value="Name" />
								</f:facet>
								<h:outputText id="name" value="aaaaaaa" />
							</rich:column>

							<rich:column>
								<f:facet name="header">
									<h:outputText value="E-mail" />
								</f:facet>
								<h:outputText id="email" value="aaaaaaa" />
							</rich:column>

							<rich:column>
								<f:facet name="header">
									<h:outputText value="Phone number" />
								</f:facet>
								<h:outputText id="phonenumber" value="aaaaaaa" />
							</rich:column>

							<rich:column>
								<f:facet name="header">
									<h:outputText value="Bigthday" />
								</f:facet>
								<h:outputText id="bigthday" value="aaaaaaa" />
							</rich:column>

							<rich:column>
								<f:facet name="header">
									<h:outputText value="Departament" />
								</f:facet>
								<%-- 
								Инфо о департаменте
								<a4j:commandLink value="Say Hello"></a4j:commandLink>
								 --%>
								<h:outputText id="departament" value="aaaaaaa" />
							</rich:column>

							<%-- <rich:column sortBy="#{author.surname}">
								<f:facet name="header">
									<h:outputText value="Surname" />
								</f:facet>
								<h:outputText id="surname" value="#{author.surname}" />
							</rich:column> --%>

							<f:facet name="footer">
								<rich:datascroller id="playerstable"></rich:datascroller>
							</f:facet>

						</rich:dataTable>
					</h:form>
				</rich:tab>

				<rich:tab label="Games">
					<h:form>
						<rich:panel>

							<rich:dataTable
								onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
								onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
								cellpadding="0" cellspacing="0" width="300" border="0"
								id="gametable">

								<rich:column>
									<f:facet name="header">
										<h:outputText value="N" />
									</f:facet>
									<h:outputText value="vvvv" />
								</rich:column>

								<rich:column>
									<f:facet name="header">
										<h:outputText value="Teams" />
									</f:facet>
									<h:outputText value="t1 + t2" />
								</rich:column>

								<rich:column>
									<f:facet name="header">
										<h:outputText value="Score" />
									</f:facet>
									<h:outputText value="sc1 : sc2" />
								</rich:column>

								<rich:column>
									<f:facet name="header">
										<h:outputText value="Location" />
									</f:facet>
									<h:outputText value="city" />
								</rich:column>

								<rich:column>
									<f:facet name="header">
										<h:outputText value="Time" />
									</f:facet>
									<h:outputText value="time" />
								</rich:column>

								<f:facet name="footer">
									<rich:datascroller id="gametable"></rich:datascroller>
								</f:facet>

							</rich:dataTable>
						</rich:panel>
					</h:form>

					<a4j:keepAlive beanName="authorBean" />
				</rich:tab>

			</rich:tabPanel>


		</a4j:form>
	</f:view>
</body>
</html>